durusmail: quixote-users: Proposed change to _traverse
Proposed change to _traverse
2000-11-09
2000-11-09
2000-11-10
2000-11-10
Proposed change to _traverse
Neil Schemenauer
2000-11-09
On Thu, Nov 09, 2000 at 03:47:44PM -0500, Andrew Kuchling wrote:
> Here are two changes to the _traverse function I'd like to make, but am
> not sure they're correct.
>
> The first fix is to move the check for __access__ before the check for
> __getname__.  Without it, __access__ is never called when there's a
> __getname__ function.

I noticed that sometimes __access__ was not being called.  I
didn't get a chance to track the problem down.  This would
explain it. +1 from me.

> The second change ensures there's a trailing slash when the traversal
> ends up at an object (most likely something returned from
> __getname__), so /process/review/300 redirects to
> /process/review/300/.

I not sure if this is always the right thing to do.  What if the
instance has a __call__() method?  Perhaps you should test for
callable objects rather than for modules or instances.  Then
again, instances with __call__ could still have other methods.
Sometime I wonder if this whole redirect idea is wrong.

  Neil


reply