[ZCM] [ZC] 1225/ 3 Resolve "minimalpath() in CMFCore.util bugfix"
Collector: Zope Bugs, Features,
and Patches ...
zope-coders-admin at zope.org
Mon Aug 9 10:16:01 EDT 2004
Issue #1225 Update (Resolve) "minimalpath() in CMFCore.util bugfix"
Status Resolved, Zope/bug medium
To followup, visit:
http://collector.zope.org/Zope/1225
==============================================================
= Resolve - Entry #3 by tseaver on Aug 9, 2004 10:16 am
Status: Pending => Resolved
________________________________________
= Comment - Entry #2 by yuppie on Aug 9, 2004 4:00 am
This is the wrong collector for CMF issues and this issue is resolved anyway.
I propose to close this issue.
________________________________________
= Request - Entry #1 by Anonymous User on Feb 10, 2004 12:23 pm
The minimalpath() function will look for the string 'Products' in a path and chop off everything to its right to keep it as a minimal path relative to the Products directory. My problem: I've writen a collection of Products called the RProducts and their paths will get removed! I've rewriten minimalpath() to look for a path component 'Products' by splitting the path using os.sep and joining the remainder.
>def minimalpath(p):
> # This trims down to just beyond a 'Products' root if it can.
> # otherwise, it returns what it was given.
> # In either case, the path is normalized.
> p = normalize(p)
>
> parts = string.split(p, os.sep)
>
> while parts[0] != "Products":
> parts = parts[1:]
>
> return string.join(parts, os.sep)
==============================================================
More information about the Zope-Collector-Monitor
mailing list