[Zope3-dev] APIs breakage
Jim Fulton
jim at zope.com
Tue Jul 13 11:00:35 EDT 2004
Garrett Smith wrote:
> Stephan Richter wrote:
>
>>On Monday 12 July 2004 12:01, Garrett Smith wrote:
>>
>>>I know this doesn't happen often, but it's fustrating when it does:
>>>
>>>Index:
>>>C:/SCM/external/zope/Zope3/src/zope/app/traversing/namespace.py
>>>===================================================================
>>>...
>>>-def getResourceInContext(ob, name, request):
>>>...
>>>+def getResource(site, name, request):
>>>
>>>This public API change, IMO, needs to come with a post to the list
>>>notifying us in no uncertain terms.
>>
>>I hope noone else is using these methods. I do *not* consider them
>>public API.
>
>
> That's interesting...what would you recommend for generating the correct
> URL for a particular resource? This is how I'm using it (stub returns an
> HTML fragment used in a view):
>
> css = getResource(self.context, 'menu.css', self.request)
> return '<link rel="stylesheet" type="text/css" href="%s" />' % css()
>
> I stole this pattern from other views, which would seem to make it a
> public API, maybe not though.
Just seeing something used in source code doesn't make something
public. Perhaps this *should* be public, but then it should be defined
in an interfaces.py file.
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the Zope3-dev
mailing list