Hi,

I'd suggest taking another look, because I *think* CP2.2 now has an
object_path or some such. I agree that there can be value in this, and
there may be no monkeypatching required now.

Kevin

On 1/15/06, Ivo van der Wijk <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
> I think it would be generally usefull to keep a stack of traversed
> objects. I currently need it in my application breadcrumb / navigation
> generation.
>
> I'm not speaking of a list of individual path elements but the actual
> objects that were traversed.
>
> Adding this functionality would be rather trivial (and I've already
> implemented in my local TG), TG is already monkeypatching CP's
> getObjFromPath (in startup.py), which does the basic traversing,
> the following diff (against 0.8a5) implements this functionality.
>
> If not accepted, I'll probably be monkeypatching CP or TG myself but
> I'd rather avoid that :)
>
>
> *** startup.py  2006-01-16 01:14:45.000000000 +0100
> --- startup-new.py 2006-01-16 01:15:14.000000000 +0100
> ***************
> *** 123,128 ****
> --- 123,129 ----
>       wp = webpath
>
>       root = cherrypy
> +     cherrypy.request.object_stack = []
>       cherrypy.request.approot = "/" + wp
>       for i in range(0, len(objPathList)):
>           # maps virtual filenames to Python identifiers (substitutes
> '.' for '_')
> ***************
> *** 134,139 ****
> --- 135,141 ----
>               cherrypy.request.approot = "/" + wp +
> "/".join(objPathList[1:i+1])          if root is None:
>               return None
> +         cherrypy.request.object_stack.append(root)
>       return root
>
>   def check_port(host, port):
>
>
> --
>
> Regards,
>
>   Ivo
>
> --
> Drs. I.R. van der Wijk / m3r Consultancy B.V.
> Linux/Python/Zope/Plone and Open Source solutions
> PO-box 51091, 1007 EB Amsterdam, The Netherlands
> Email: ivo <at> m3r.nl
>


--
Kevin Dangoor
Author of the Zesty News RSS newsreader

email: [EMAIL PROTECTED]
company: http://www.BlazingThings.com
blog: http://www.BlueSkyOnMars.com

Reply via email to